package com.lsk.card;

import com.jfinal.core.Controller;
import com.jfinal.weixin.sdk.api.ApiResult;
import com.jfinal.weixin.sdk.api.PoiApi;
import com.jfinal.weixin.sdk.api.ReturnCode;
import com.jfinal.weixin.sdk.api.bean.Poi;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2018/9/5 0005.
 */
public class BusinessController extends Controller{
    public void addPoi(){
        Poi poi=new Poi();
        poi.setBusiness_name("测试门店");
        poi.setBranch_name("测试门店1");
        poi.setProvince("河南省");
        poi.setCity("郑州市");
        poi.setDistrict("凤凰城");
        poi.setAddress("A区8灵儿");
        poi.setTelephone("13083690563");
        List<String> categories=new ArrayList<>();
        categories.add("美食");
        poi.setCategories(categories);
        poi.setOffset_type(2);
        poi.setLatitude("32.378939");
        poi.setLongitude("102.532417");
        ApiResult apiResult= PoiApi.addPoi(poi);
        System.out.println(apiResult.getJson());
        System.out.println(ReturnCode.get(apiResult.getErrorCode()));
        renderText(apiResult.getJson());
    }
}
